import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/user',
    children:[
      {path: '/user', component: () => import('../views/user/UserView.vue')},
      {path: '/server', component: () => import('../views/user/ServerView.vue')},
      {path: '/doctor', component: () => import('../views/user/DoctorView.vue')},
      {path: '/service', component: () => import('../views/service/ServiceView.vue')},
      {path: '/doctors', component: () => import('../views/service/DoctorsView.vue')},

      {path: '/application', component: () => import('../views/schedule/ApplicationView.vue')},
      {path: '/audit', component: () => import('../views/schedule/AuditView.vue')},
      {path: '/distribute', component: () => import('../views/schedule/DistributeView.vue')},
      {path: '/DotApplication', component: () => import('../views/schedule/DotApplicationView.vue')},
      {path: '/DotAudit', component: () => import('../views/schedule/DotAuditView.vue')},
      {path: '/DotDistribute', component: () => import('../views/schedule/DotDistributeView.vue')},
    ]
  },
  {path: '/login', component: () => import('../views/LoginView')},
  {path: '/look', component: () => import('../views/LookView.vue')},
  {path: '/homeService', component: () => import('../views/HomeServiceView.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
